Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Flash by default and allow enabling with CTP #116

Merged
merged 2 commits into from
May 31, 2018
Merged

Block Flash by default and allow enabling with CTP #116

merged 2 commits into from
May 31, 2018

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented May 28, 2018

Fix brave/brave-browser#30

By setting the default content setting to Block, this ensures there's at least a couple steps needed to get Flash working.


If Flash is not installed:

navigator.plugins obviously doesn't show Flash here.

No extra code nor UI for that.


If Flash is installed:

navigator.plugins doesn't show Flash here.

screen shot 2018-05-28 at 1 26 09 am


Clicking on the icon in the URL bar:

navigator.plugins doesn't show Flash here.

screen shot 2018-05-28 at 1 26 26 am


Page reloads with Click to Play:

navigator.plugins doesn't show Flash here.

screen shot 2018-05-28 at 1 26 38 am


Clicking on the Flash content:

navigator.plugins doesn't show Flash here.

screen shot 2018-05-28 at 1 26 45 am


Finally Flash is played:

navigator.plugins will show Flash here.

screen shot 2018-05-28 at 1 26 50 am


Limitations:

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@bbondy bbondy changed the title WIP: Disable Flash by default and allow enabling with CTP WIP: Block Flash by default and allow enabling with CTP May 28, 2018
@bbondy bbondy force-pushed the flash branch 2 times, most recently from ab1540d to fdd2652 Compare May 28, 2018 13:02
@bbondy bbondy self-assigned this May 28, 2018
@bbondy bbondy changed the title WIP: Block Flash by default and allow enabling with CTP Block Flash by default and allow enabling with CTP May 28, 2018
@bbondy bbondy requested review from yrliou and diracdeltas and removed request for diracdeltas May 28, 2018 19:52
@bbondy
Copy link
Member Author

bbondy commented May 29, 2018

Talked to @diracdeltas on Slack and she's OK with the approach. She wants the settings to expire which should happen with C68 and is tracked by the issue linked above.

yrliou
yrliou previously approved these changes May 30, 2018
Copy link
Member

@yrliou yrliou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall LGTM, please see inline comments for few nits.

@@ -16,6 +16,7 @@ const char kFingerprinting[] = "fingerprinting";
const char kBraveShields[] = "braveShields";
const char kReferrers[] = "referrers";
const char kCookies[] = "cookies";
const char kFlash[] = "adobe-flash-player";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this constant still being used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, I'll remove before landing.

ContentSettingsPattern::FromString("http://a.com/*");
}

// PermissionsBrowserTest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove extra spaces here to align with the next line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove the comment, it's not helpful and I think it was just copied in from somewhere.


bool RunScriptReturnBool(const std::string &script) {
bool value;
EXPECT_TRUE(ExecuteScriptAndExtractBool(contents(), script, &value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: generally I would prefer to avoid putting EXPECT/ASSERT codes inside a function since it would be harder to see where it actually failed when you call it multiple times in a single test. I'm OK with it since currently it is called only once.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's only used once anyway, I'll just not have that helper.

@bbondy bbondy merged commit cb58b44 into master May 31, 2018
@bsclifton bsclifton deleted the flash branch June 18, 2018 06:28
NejcZdovc pushed a commit that referenced this pull request Dec 10, 2018
…rewards panel

Fixed getting favicon for Twitch vod

Update for youtube showing up right away in panel.

Stabilized youtube media publisher panel

Removing debug log lines

Cleaned up redundant database functionality

Stabilized youtube media publisher panel

clean up debug comments

Replaced accidentally removed line

Merge

Fixes exclude/include on fresh site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants